﻿/**
Library: transition managing library (TraM)
Author: Valentyn Derkach 2007.07.04
// ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————
/**/
package com.bizmlib.tram
{

	import flash.events.Event;


	public class TraMEvent extends Event
	{

		public static const EXECUTION:String = "execution";
		public static const COMPLETED:String = "completed";
		public static const INTERRUPT:String = "interrupt";
		public static const TYPE_EXECUTION:String = EXECUTION;
		public static const TYPE_COMPLETED:String = COMPLETED;
		public static const TYPE_INTERRUPT:String = INTERRUPT;

		private var __subject:Object;
		private var __transitionName:String;
		private var __properties:Object;


		public function TraMEvent(type:String, subject:Object = null, properties:Object = null, transition:String = "none")
		{
			super(type, false, true);

			__subject = subject;
			__properties = properties;
			__transitionName =  transition;
		}


		public function get subject():Object
		{
			return __subject;
		}
		public function get properties():Object
		{
			return __properties;
		}
		public function get transitionName():String
		{
			return __transitionName;
		}


		/** 
		 *	Returns a string that describes the current instance.
		 */
		public override function toString():String
		{
			return formatToString("TraMEvent", "type", "bubbles", "cancelable", "eventPhase", "subject", "transitionName", "properties");
		}
		/**
		 *	Creates and returns a copy of the current instance.
		 *	@return	A copy of the current instance.
		 */
		public override function clone():Event
		{
			return new TraMEvent(type, subject, properties, transitionName);
		}

	}

}